﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using Moq;
using TDDStudy.Library.WhatIsMock;

namespace TDDStudy.WhatIsMock
{
    [TestClass]
    public class WhatIsStubTest
    {
        [TestMethod]
        public void Mock_Test()
        {
            var mock = CreateMockDependencyService();

            var domainService = new DomainService(mock.Object);
            domainService.Task();

            mock.Verify(x => x.OtherTask(), Times.AtMostOnce);
        }

        private Mock<IDependencyService> CreateMockDependencyService()
        {
            return new Mock<IDependencyService>();
        }
    }
}
